package tuling.EalyAopZskDemo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by xsls on 2019/6/10.
 */
public class TulingMainClass {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(EalyAopZksConfig.class);
		Calc tulingCalculate = ctx.getBean("calc",Calc.class);
		System.out.println("res = " + tulingCalculate.add(1, 1));
		System.out.println("num = " + tulingCalculate.num);
		System.out.println("cls = " + tulingCalculate.getClass().getName());

		// FactoryBean方式单个： ProxyFactoryBean
		// Calc clc = ctx.getBean("calcProxy",Calc.class);
		// System.out.println("res = " + clc.add(1, 1));
		// System.out.println("num = " + clc.num);
		// System.out.println("cls = " + clc.getClass().getName());

		// nameAdvisor 方式
		// Calc clc = ctx.getBean("calcProxy",Calc.class);
		// System.out.println("res = " + clc.add(1, 1));
		// System.out.println("num = " + clc.num);
		// System.out.println("cls = " + clc.getClass().getName());

        /*AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(EalyAopMainConfig.class);
        Calculate calculateProxy = ctx.getBean("calculateProxy",Calculate.class);
        System.out.println(calculateProxy.getClass());
        calculateProxy.div(1,1);*/

    }
}
